package com.hospital.hospitalsystem.modules.user.service;

import com.hospital.hospitalsystem.modules.doctor.dto.*;
import com.hospital.hospitalsystem.modules.frontDesk.dto.SearchOrderListRsp;
import com.hospital.hospitalsystem.modules.frontDesk.dto.SearchOrderReq;
import com.hospital.hospitalsystem.modules.medicine.dto.ShowPrescriptionReq;
import com.hospital.hospitalsystem.modules.medicine.dto.ShowPrescriptionRsp;
import com.hospital.hospitalsystem.modules.user.dao.entity.BookEntity;
import com.hospital.hospitalsystem.modules.user.dao.mapper.BookMapper;
import com.hospital.hospitalsystem.modules.user.dto.ListBookReq;
import com.hospital.hospitalsystem.modules.user.dto.ListBookRsp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;

import java.util.Date;
import java.util.List;

/**
 * @author qiancheng@cqxyy.net
 * @date 2023/2/23
 */
@Component
public class BookService {

    @Autowired
    private BookMapper bookMapper;

    public List<BookEntity> selectByExample(Example example){
        return bookMapper.selectByExample(example);
    }

    public void insertSelective(BookEntity bookEntity){
        bookMapper.insertSelective(bookEntity);
    }

    public void deleteByExample(Example example){
        bookMapper.deleteByExample(example);
    }

    public BookEntity selectOneByExample(Example example){
        return bookMapper.selectOneByExample(example);
    }

    public void updateByPrimaryKeySelective(BookEntity bookEntity){
        bookMapper.updateByPrimaryKeySelective(bookEntity);
    }

    public List<ListBookRsp> ListBookRsp(ListBookReq req) {
        return bookMapper.ListBookRsp(req);
    }

    public List<DoctorBookExt> selectDate(Date startWeek, Date endWeek, List<Integer> status, String hospitalUuid, String doctorUuid) {
        return bookMapper.selectDate(startWeek,endWeek,status,hospitalUuid,doctorUuid);
    }

    public List<DoctorBookTmpExt> selectTmp(Date startWeek, Date endWeek, List<Integer> status, String hospitalUuid, String doctorUuid) {
        return bookMapper.selectTmp(startWeek,endWeek,status,hospitalUuid,doctorUuid);
    }

    public void updateByExampleSelective(BookEntity bookEntity,Example example){
        bookMapper.updateByExampleSelective(bookEntity,example);
    }

    public List<SearchOrderListRsp> getBook(SearchOrderReq req) {
        return bookMapper.getBook(req);
    }

    public List<DoctorNumberCheckExt> numberCheck(DoctorNumberCheckReq req) {
        return bookMapper.numberCheck(req);
    }

    public List<MessageBookUuidRsp> messageBookUuid(MessageBookUuidReq req) {
        return bookMapper.messageBookUuid(req);
    }

    public List<ShowPrescriptionRsp> showPrescription(ShowPrescriptionReq req) {
        return bookMapper.showPrescription(req);
    }
}
